public class Test {
    public static void main(String[] args) {
        int a = 10;
        int b = a * (3 + 5);
        System.out.println(b);//80
    }

    public static void main20(String[] args) {
        int a = 10;
        int b = 20;
        int max = a > b ? a : b;//20
        System.out.println(max);
    }

    public static void main19(String[] args) {
        int a = 10;
        int b = 20;

        System.out.println(a == b);//false
        System.out.println(a != b);//true
        System.out.println(a < b);//true

    }

    public static void main18(String[] args) {
        int a = 10;
        int b = ++a;
        int c = a++;
        System.out.println(a);//12
        System.out.println(b);//11
        System.out.println(c);//11
    }

    public static void main17(String[] args) {
        int a = 1;
        a += 1.5;
        // a = (int)(a + 1.5);
        System.out.println(a);///2

    }

    public static void main16(String[] args) {
        int a = 1;

        a += 2;
        System.out.println(a);//3

        a -= 1;
        System.out.println(a);//2
    }

    public static void main15(String[] args) {
        int a = 20;
        int b = 10;
        System.out.println(a / b);//注意： b 不能为 0

        System.out.println(7%3);//1
        System.out.println(-7%3);//-1
        System.out.println(7%-3);//-1
        System.out.println(-7%-3);//-1

        System.out.println(11.5%2.0);//1.5

    }

    public static void main14(String[] args) {
        String str = "123";

        int a = Integer.parseInt(str);
        System.out.println(a);//123

        long d = Long.parseLong(str);
        System.out.println(d);//123
    }

    public static void main13(String[] args) {
        int num = 10;
        int a = 229;
        String s1 = num + "";
        System.out.println(s1);//

//String.valueOf() 是一个将各种类型的数据转换为字符串类型的方法
        String s2 = String.valueOf(num);//10
        System.out.println(s2);

        String s3 = String.valueOf(a);
        System.out.println(s3);//229

    }

    public static void main12(String[] args) {
        int a = 10;
        System.out.println("a = " +a);

        int b = 20;
        System.out.println("b = " +b);

        System.out.println("a + b = " +(a + b));// a + b = 10

        System.out.println("a + b = " +a + b);// a + b = 1020

        System.out.println(a + b+"a + b ="); //30a+b =
    }

    public static void main11(String[] args) {
        String str = "hello";
        System.out.println(str);//hello

        String str2 = "world";
        System.out.println(str2);//world
        //拼接
        String str3 = str + str2;
        System.out.println(str3);//helloworld

    }

    public static void main10(String[] args) {
//        int a = 10;
//        long b = 20;
//// problem 类型不同运算是怎么回事==================================
//提升为更大的类型（long）
//        long c = a + b;
//        long d = a + b;
//        System.out.println(c);

        byte a = 10;
        byte b = 20;
        int c = a + b;

        byte d = (byte)(a + b);

        System.out.println(c);
        System.out.println(d);
    }

    public static void main9(String[] args) {
        long a = 10L;
        int b = (int)a;
//先提升为4个字节再运算
        byte c = (byte)128;
        System.out.println(c);

// problem  这里说的机制是什么意思===========================
        byte d = 10;//字面值没有超过范围，就不会触发那个机制

    }

    public static void main8(String[] args) {
        boolean flg = false;
        System.out.println(flg);

    }

    public static void main7(String[] args) {
        char ch = 'A';
        char ch2 = '中';

        System.out.println(ch);
        System.out.println(ch2);
//problem  =================================
        System.out.println(Character.MAX_VALUE);
        System.out.println(Character.MIN_VALUE);

        char ch3 = 97;
        System.out.println(ch3);
    }

    public static void main6(String[] args) {
        float f = 12.5f;
        System.out.println(f);
        System.out.println(Float.MAX_VALUE);
        System.out.println(Float.MIN_VALUE);
    }

    public static void main5(String[] args) {
        double d = 12.5;
        System.out.println(d);
        System.out.println(Double.MAX_VALUE);
        System.out.println(Double.MIN_VALUE);
        System.out.println("==================");
        double a = 1.0;
        double b = 2.0;
        System.out.println(a/b);
        System.out.println("==================");
        double num = 1.1;
        System.out.println(num*num);
    }

    public static void main4(String[] args) {
        byte a = 10;
        System.out.println(a);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }

    public static void main3(String[] args) {
        short a = 32767;
        System.out.println(a);
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);

    }

    public static void main2(String[] args) {
        long d = 10L;
        System.out.println(d);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);

    }

    public static void main1(String[] args) {
        int d = 10;
        System.out.println(d);
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);
    }
}

